﻿// ***********************************************************************
// Assembly         : MVC4Portal
// Author           : LJO+01
// Created          : 09-22-2013
//
// Last Modified By : Lolo
// Last Modified On : 09-30-2013
// ***********************************************************************
// <copyright file="ContactCompetenciesController.cs" company="">
//     Copyright (c) . All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using System.Web.Http.OData.Query;
using InnovaApp.Layers.DataLayer;
using InnovaApp.Layers.DomainLayer;
using System.Web.Security;
using System.Web.Http.OData;

namespace InnovaApp.Portals.MVC4Portal.Controllers.ODataControllers
{
    /// <summary>
    /// Class ContactCompetenciesController.
    /// </summary>
    [Authorize]
    public class ContactCompetenciesController : ODataController
    {
        public PageResult<v_ContactCompetencies> Get(ODataQueryOptions options)
        {
            PageResult<v_ContactCompetencies> toReturn;
            DataRepositories _dataContext = new DataRepositories();
            var dbList = _dataContext.v_ContactCompetencies_Rep.GetAll().AsQueryable();
            IEnumerable<v_ContactCompetencies> results = (IEnumerable<v_ContactCompetencies>)options.ApplyTo(dbList);
            toReturn = new PageResult<v_ContactCompetencies>(results, Request.GetNextPageLink(), Request.GetInlineCount());
            return toReturn;
        }

    }
}